#pragma once
#include"Lock.hpp"
namespace CondModule
{
    using namespace LockModule;
    class Cond
    {
        public:
        Cond()
        {
            pthread_cond_init(&cond,nullptr);
        }
        ~Cond()
        {
            pthread_cond_destroy(&cond);
        }
        void Wait(LockModule::Mutex& mutex)
        {
            pthread_cond_wait(&cond,mutex.GetMutexOriginal());
        }
        void Notify()
        {
            pthread_cond_signal(&cond);
        }
        void NotifyAll()
        {
            pthread_cond_broadcast(&cond);
        }
        private:
        pthread_cond_t cond;
    };
}